package com.magist.manage.util;

import com.magist.core.enums.UserTypeEnum;
import com.magist.manage.web.entity.UserInfo;
import tk.mybatis.mapper.entity.Example;

public class AuthFilterUtil {

    public static void  doAddAuthCondition(Example example, UserInfo userInfo) {
        if (UserTypeEnum.OP.getCode().equals(userInfo.getUserType())) {
            Example.Criteria criteria = example.createCriteria();
            criteria.orEqualTo("createById", userInfo.getId());
            criteria.orEqualTo("authById", userInfo.getId());
            example.and(criteria);
        }
    }


}
